

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>表单组合</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="__STATIC__/layuikn/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__STATIC__/layuikn/style/admin.css" media="all">
</head>

<style>
    #option_jibing .layui-form-checkbox{
        margin-bottom: 10px;
    }
    .layui-form-radio{
        margin: 0;
    }
    .layui-form-label{
        /*width: 180px;*/
    }
    .layui-input:disabled{
        background: rgb(248,248,248);
    }
    form .layui-row{
        margin-bottom: 10px;
    }
</style>

<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header"><h2>生活质量量表</h2></div>
        <div class="layui-card-body" style="padding: 15px;">
            <fieldset class="layui-elem-field" style="padding: 20px;">
                <legend style="font-size: 15px;">个人信息</legend>
                <div class="layui-row">
                    <div class="layui-col-md4">住院号：<span id="huanzhe_hospital_id"></span></div>
                    <div class="layui-col-md4">姓名：<span id="huanzhe_name"></span></div>
                    <div class="layui-col-md4">性别：<span id="huanzhe_gender"></span></div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md4">科室：<span id="huanzhe_keshi"></span></div>
                    <div class="layui-col-md4">年龄：<span id="huanzhe_age"></span></div>
                    <div class="layui-col-md4">录入日期：<span id="huanzhe_created"></span></div>
                </div>
            </fieldset>
            <form class="layui-form" action="" lay-filter="pgsgayisheng-form">
                <fieldset class="layui-elem-field" style="padding: 20px;">
                    <legend style="font-size: 15px;">生活质量表</legend>
                    <div class="layui-row">
                        <div class="layui-row">
                            <div class="layui-col-md6">
                                &nbsp;
                            </div>
                            <div class="layui-col-md6">
                               <div class="layui-col-md3">没有</div>
                               <div class="layui-col-md3">有点</div>
                               <div class="layui-col-md3">相当</div>
                               <div class="layui-col-md3">非常</div>
                            </div>
                        </div>

                       <div class="layui-row">
                           <div class="layui-col-md6">
                               1. 您从事一些费力活动有困难吗，比如提很重的购物袋或手提箱？
                           </div>
                           <div class="layui-col-md6">
                               <div class="layui-col-md3">
                                   <input type="radio" name="shzllb_1" filter="shzllb_1" value="1" title="1" score="1">
                               </div>
                               <div class="layui-col-md3">
                                   <input type="radio" name="shzllb_1" filter="shzllb_1" value="2" title="2" score="2">
                               </div>
                               <div class="layui-col-md3">
                                   <input type="radio" name="shzllb_1" filter="shzllb_1" value="3" title="3" score="3">
                               </div>
                               <div class="layui-col-md3">
                                   <input type="radio" name="shzllb_1" filter="shzllb_1" value="4" title="4" score="4">
                               </div>
                           </div>
                       </div>
                        <div class="layui-row">
                            <div class="layui-col-md6">
                                2. 长距离行走对您来说有困难吗？
                            </div>
                            <div class="layui-col-md6">
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_2" filter="shzllb_2" value="1" title="1" score="1">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_2" filter="shzllb_2" value="2" title="2" score="2">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_2" filter="shzllb_2" value="3" title="3" score="3">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_2" filter="shzllb_2" value="4" title="4" score="4">
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md6">
                                3. 户外短距离行走对您来说有困难吗？
                            </div>
                            <div class="layui-col-md6">
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_3" filter="shzllb_3" value="1" title="1" score="1">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_3" filter="shzllb_3" value="2" title="2" score="2">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_3" filter="shzllb_3" value="3" title="3" score="3">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_3" filter="shzllb_3" value="4" title="4" score="4">
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md6">
                                4. 您白天需要呆在床上或椅子上吗？
                            </div>
                            <div class="layui-col-md6">
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_4" filter="shzllb_4" value="1" title="1" score="1">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_4" filter="shzllb_4" value="2" title="2" score="2">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_4" filter="shzllb_4" value="3" title="3" score="3">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_4" filter="shzllb_4" value="4" title="4" score="4">
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md6">
                                5. 您吃饭、穿衣、洗澡或上厕所时需要他人帮忙吗？
                            </div>
                            <div class="layui-col-md6">
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_5" filter="shzllb_5" value="1" title="1" score="1">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_5" filter="shzllb_5" value="2" title="2" score="2">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_5" filter="shzllb_5" value="3" title="3" score="3">
                                </div>
                                <div class="layui-col-md3">
                                    <input type="radio" name="shzllb_5" filter="shzllb_5" value="4" title="4" score="4">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-row" style="margin-top: 15px;">
                        <div class="layui-row">
                            <div class="layui-col-md6" style="font-weight: 600;">
                                在过去的一星期内：
                            </div>
                            <div class="layui-col-md6">
                                <div class="layui-col-md3">没有</div>
                                <div class="layui-col-md3">有点</div>
                                <div class="layui-col-md3">相当</div>
                                <div class="layui-col-md3">非常</div>
                            </div>
                        </div>
                        <div id="zgqyxqn">
                            <div class="layui-row">
                                <div class="layui-col-md6">
                                    6. 您在工作和日常活动中是否受到限制？
                                </div>
                                <div class="layui-col-md6">
                                    <div class="layui-col-md3">
                                        <input type="radio" name="shzllb_6" filter="shzllb_6" value="1" title="1" score="1">
                                    </div>
                                    <div class="layui-col-md3">
                                        <input type="radio" name="shzllb_6" filter="shzllb_6" value="2" title="2" score="2">
                                    </div>
                                    <div class="layui-col-md3">
                                        <input type="radio" name="shzllb_6" filter="shzllb_6" value="3" title="3" score="3">
                                    </div>
                                    <div class="layui-col-md3">
                                        <input type="radio" name="shzllb_6" filter="shzllb_6" value="1" title="4" score="4">
                                    </div>
                                </div>
                            </div>
                        </div>


                    </div>
                    <div class="layui-row" style="margin-top: 15px;">
                        <div class="layui-row">
                            <div class="layui-col-md6" style="font-weight: 600;">
                                对下列问题，请在1-7之间选出一个最适合您的数字并选择。
                            </div>
                            <div class="layui-col-md6">
                                <div class="layui-inline" style="width: 13%;">非常差</div>
                                <div class="layui-inline" style="width: 13%;">&nbsp;</div>
                                <div class="layui-inline" style="width: 13%;">&nbsp;</div>
                                <div class="layui-inline" style="width: 13%;">&nbsp;</div>
                                <div class="layui-inline" style="width: 13%;">&nbsp;</div>
                                <div class="layui-inline" style="width: 13%;">&nbsp;</div>
                                <div class="layui-inline" style="width: 13%;">非常好</div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md6">
                                29. 您如何评价在过去一星期内您总的健康情况？
                            </div>
                            <div class="layui-col-md6">
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_29" filter="shzllb_29" value="1" title="1" score="1">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_29" filter="shzllb_29" value="2" title="2" score="2">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_29" filter="shzllb_29" value="3" title="3" score="3">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_29" filter="shzllb_29" value="4" title="4" score="4">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_29" filter="shzllb_29" value="5" title="5" score="5">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_29" filter="shzllb_29" value="6" title="6" score="6">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_29" filter="shzllb_29" value="7" title="7" score="7">
                                </div>
                            </div>
                        </div>
                        <div class="layui-row">
                            <div class="layui-col-md6">
                                30. 您如何评价在过去一星期内您总的生命质量？
                            </div>
                            <div class="layui-col-md6">
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_30" filter="shzllb_30" value="1" title="1" score="1">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_30" filter="shzllb_30" value="2" title="2" score="2">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_30" filter="shzllb_30" value="3" title="3" score="3">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_30" filter="shzllb_30" value="4" title="4" score="4">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_30" filter="shzllb_30" value="5" title="5" score="5">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_30" filter="shzllb_30" value="6" title="6" score="6">
                                </div>
                                <div class="layui-inline" style="width: 13%;">
                                    <input type="radio" name="shzllb_30" filter="shzllb_30" value="7" title="7" score="7">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-row" style="margin-top: 15px;">
                        <div class="layui-form-item">
                            <label class="layui-form-label" style="width: auto;padding-left: 0;">总评分</label>
                            <div class="layui-input-inline">
                                <input type="text" name="total_score" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">分</div>
                        </div>
                    </div>
                    <div class="layui-row" style="margin-top: 15px;">
                        注: 总评分可以从整体生存质量评价维度计算获得，通过加权平均和线性转换使其得分在1-100之间。
                    </div>
                    <div class="layui-row">
                        得分差异在0-9分， 为无改变；10-20分之间，有改变，但不明显；大于20分，意味着明显下降。
                    </div>
                </fieldset>
                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button class="layui-btn" lay-submit="" lay-filter="last">上一步</button>
                            <button class="layui-btn" lay-submit="" lay-filter="next">下一步</button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>

</div>


<script src="__STATIC__/layuikn/layui/layui.js"></script>
<script>
    layui.config({
        base: '__STATIC__/layuikn/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
        ,ajaxData:'../extends/ajaxData'
        ,getOption:'../extends/getOption'
    }).use(['index', 'jquery', 'ajaxData', 'getOption', 'form', 'laydate'], function(){
        var $ = layui.$
            ,admin = layui.admin
            ,element = layui.element
            ,layer = layui.layer
            ,laydate = layui.laydate
            ,ajaxData = layui.ajaxData
            ,getOption = layui.getOption
            ,form = layui.form;

        var pid = sessionStorage.getItem('pid');
        ajaxData.ajaxData('GET',"{:url('patient/info')}?pid=" + pid,{},function (back) {
            if(back.data){
                $('#huanzhe_hospital_id').html(back.data.hospital_id);
                $('#huanzhe_name').html(back.data.name);
                $('#huanzhe_gender').html(back.data.gender);
                $('#huanzhe_keshi').html(back.data.keshi);
                $('#huanzhe_age').html(back.data.age);
                $('#huanzhe_created').html(back.data.created);
                $('input[name="age"]').val(back.data.age);
            }
        });

        var option_all;


        $.ajax({
            url: "{:url('option/all',[])}",
            type: 'get',
            contentType: 'application/json',
            dataType: 'json',
            async: false, // 同步
            success: function (result) {
                option_all = result;
            }
        });

        //渲染数据
        var title_array = [
            '6. 您在工作和日常活动中是否受到限制？',
            '7. 您在从事您的爱好或休闲活动时是否受到限制？',
            '8. 您有气促吗？',
            '9. 您有疼痛吗？',
            '10. 您需要休息吗？',
            '11. 您睡眠有困难吗？',
            '12. 您觉得虚弱吗？',
            '13. 您食欲不振（没有胃口）吗？',
            '14. 您觉得恶心吗？',
            '15. 您有呕吐吗？',
            '16. 您有便秘吗？',
            '17. 您有腹泻吗？',
            '18. 您觉得累吗？',
            '19. 疼痛影响您的日常活动吗？',
            '20. 您集中精力做事有困难吗，如读报纸或看电视？',
            '21. 您觉得紧张吗？',
            '22. 您觉得忧虑吗？',
            '23. 您觉得脾气急躁吗？',
            '24. 您觉得压抑（情绪低落）吗？',
            '25. 您感到记忆困难吗？',
            '26. 您的身体状况或治疗影响您的家庭生活吗？',
            '27. 您的身体状况或治疗影响您的社交活动吗？',
            '28. 您的身体状况或治疗使您陷入经济困难吗？'
        ];
        var zgqyxqn_html = '';
        for (var i = 6; i<= 28; i++){
            zgqyxqn_html += ' <div class="layui-row">\n' +
            '                    <div class="layui-col-md6">\n'+
                                    title_array[i-6]+
            '                    </div>\n' +
            '                    <div class="layui-col-md6">\n' +
            '                        <div class="layui-col-md3">\n' +
            '                            <input type="radio" name="shzllb_' + i + '" filter="shzllb_' + i + '" value="1" title="1" score="1">\n' +
            '                        </div>\n' +
            '                        <div class="layui-col-md3">\n' +
            '                            <input type="radio" name="shzllb_' + i + '" filter="shzllb_' + i + '" value="2" title="2" score="2">\n' +
            '                        </div>\n' +
            '                        <div class="layui-col-md3">\n' +
            '                            <input type="radio" name="shzllb_' + i + '" filter="shzllb_' + i + '" value="3" title="3" score="3">\n' +
            '                        </div>\n' +
            '                        <div class="layui-col-md3">\n' +
            '                            <input type="radio" name="shzllb_' + i + '" filter="shzllb_' + i + '" value="1" title="4" score="4">\n' +
            '                        </div>\n' +
            '                    </div>\n' +
            '                </div>';
        }
        $('#zgqyxqn').html(zgqyxqn_html);
        form.render();
        ajaxData.ajaxData('GET',"{:url('shzl/info')}?pid=" + pid,{},function (back) {

            if(back.data){
                //给表单赋值
                form.val("pgsgayisheng-form", back.data);
                if($('input[name="yaowu"]').val() != ''){
                    $('input[name="yaowu"]').removeAttr('disabled');
                }
                if($('input[name="jiliang"]').val() != ''){
                    $('input[name="jiliang"]').removeAttr('disabled');
                }
            }
            //form.render();
        });
        form.on('submit(last)',function(data){
            if(pid == 'null') return  false;
            window.location.href = "{:url('nrs2002/show')}";
            return  false;
        });
        /* 监听提交 */
        form.on('submit(next)', function(data){
            console.log({'shzl_info':data.field})
            if(pid == 'null') return  false;
            ajaxData.ajaxData('POST', "{:url('shzl/update')}?pid=" + pid, {'shzl_info':data.field},function (back) {
                console.log(data.field);
                if(back.code == 200){
                    window.location.href = "{:url('lcjj/show')}";
                }else{
                    layer.msg(back.msg, {icon: 5});
                }
            });
            // parent.layer.alert(JSON.stringify(data.field), {
            //     title: '最终的提交信息'
            // })
            return false;
        });

    });
</script>
</body>
</html>
